package com.example.module_live

import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.alibaba.android.arouter.facade.annotation.Route
import com.baweigame.xmpplibrary.XmppManager

@Route(path = "/live/LiveActivity")
class LiveActivity : AppCompatActivity() {
    private val a by lazy{A()}
    private val b by lazy{B()}

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_live)
        Thread{

            a.sendMessage()
        }.start()
        val looper:Looper
    }

    fun register(view: View) {
        XmppManager.getInstance().xmppUserManager.createAccount("fusiyuan","1234567")
    }
    fun login(view: View) {
        XmppManager.getInstance().xmppUserManager.login("fusiyuan","1234567")
    }

    class B{
        fun sendMessage(){
            Log.d("TAG", "sendMessageBB: "+Thread.currentThread().name)

        }
    }

    inner class A{
        fun sendMessage(){
            b.sendMessage()
            Log.d("TAG", "sendMessageAA: "+Thread.currentThread().name)

        }
    }
}